package com.duckygo.towerdefense.game.sprites;

import java.util.Vector;

import javax.microedition.khronos.opengles.GL10;

import android.hardware.SensorEvent;
import android.view.KeyEvent;
import android.view.MotionEvent;

import com.duckygo.towerdefense.game.scenes.SceneManager;

public class Sprite implements ISprite {

	public Sprite parent;
	
	public Vector<Sprite> children = new Vector<Sprite>();
	
	public boolean childrenUpdated = false;

	public boolean visible = true;

	
	@Override
	public void draw(GL10 gl) {
	}

	@Override
	public void update(long time) {

	}
	
	@Override
	public boolean onTouchEvent(MotionEvent event) {
		return false;
	}

	@Override
	public void onSensorEvent(SensorEvent sensor) {
		
	}

	@Override
	public boolean onKeyEvent(KeyEvent event, int keyCode) {
		return false;
	}

	
	public void addChild(Sprite child) {
		children.add(child);
		child.parent = this;
		
		SceneManager.getInstance().invalidDisplayList = true;
	}
	
	public void removeChild(Sprite child) {
		children.remove(child);
		child.parent = null;
		
		SceneManager.getInstance().invalidDisplayList = true;
	}



}
